<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- 指令都有一个特点v-开头 -->
    <!-- 指令是属性 -->
    <div id="app" @click="message+='~'">{{message}}
        <!-- 1 -->
        <h1 v-html="content"></h1>
        <div v-text="content"></div>
        <!-- 2 v-if 和v-else  和v-show 的区别 -->
        <h1 v-if="age>18">成年人</h1>
        <h2 v-else>未成年</h2>
        <h1 v-show="age>=18">成年人</h1>
        <h2 v-show="age<18">未成年</h2>
    </div>


    <script src="vue.js"></script>
    <script>
        new Vue({
            el: "#app",
            data: {
                message: "Hello Vue.js",
                content: '<span>123</span>',
                age: 20,
            }
        });

    </script>
</body>

</html>